package com.Model.Pojo;

import com.sql.DAO;

public class Users {
	
	private String name;
	private String pass;
	private int yue;
	private String xingming;
	private String youxiang;
	private String shoujihao;
	private int money;
	private String sql;
	
	public void setZhanghao(String zhanghao){
		this.name = zhanghao;
	}
	public void setMima(String mima){
		this.pass = mima;
	}
	public void setYue(int yue){
		this.yue = yue;
	}
	public void setXingming(String xingming){
		this.xingming = xingming;
	}
	public void setYouxiang(String youxiang){
		this.youxiang = youxiang;
	}
	public void setShoujihao(String shoujihao){
		this.shoujihao = shoujihao;
	}
	public void setMoney(int money) {
		// TODO Auto-generated method stub
		this.money = money;
	}
	
	public String getZhanghao(){
		return name;
	}
	public String getMima(){
		return pass;
	}
	public int getYue(){
		return yue;
	}
	public String getXingming(){
		return xingming;
	}
	public String getYouxiang(){
		return youxiang;
	}
	public String getShoujihao(){
		return shoujihao;
	}
	public int getMoney(){
		return money;
	}
	
	public void xiugaimima(String mima){
		this.pass = mima;
		mima = mima + "1";
		DAO dao = new DAO();
		sql = "update users set pass='" + mima + "' where name='" + name + "' ";
		dao.xiugai(sql);
	}
	public void xiugaiyue(int yue){
		this.yue = yue;
		DAO dao = new DAO();
		sql = "update users set yue='" + yue + "' where name='" + name + "' ";
		dao.xiugai(sql);
	}
	public void xiugaixingming(String xingming){
		this.xingming = xingming;
		DAO dao = new DAO();
		sql = "update users set xingming='" + xingming + "' where name='" + name + "' ";
		dao.xiugai(sql);
	}
	public void xiugaiyouxiang(String youxiang){
		this.youxiang = youxiang;
		DAO dao = new DAO();
		sql = "update users set youxiang='" + youxiang + "' where name='" + name + "' ";
		dao.xiugai(sql);
	}
	public void xiugaishoujihao(String shoujihao){
		this.shoujihao = shoujihao;
		DAO dao = new DAO();
		sql = "update users set shoujihao='" + shoujihao + "' where name='" + name + "' ";
		dao.xiugai(sql);
	}
	public void xiugaimoney(int money) {
		// TODO Auto-generated method stub
		this.money = money;
		DAO dao = new DAO();
		sql = "update users set money='" + money + "' where name='" + name + "' ";
		dao.xiugai(sql);
	}
	
	public boolean isYouxiang(String youxiang){
		boolean flag;
		String type = "youxiang";
		sql = "select * from users where " + type + " = '" + youxiang + "'";
		DAO dao = new DAO();
		flag = dao.login(sql);
		return flag;
	}
	public boolean isShoujihao(String shoujihao) {
		boolean flag;
		String type = "shoujihao";
		sql = "select * from users where " + type + " = '" + shoujihao + "'";
		DAO dao = new DAO();
		flag = dao.login(sql);
		return flag;
	}

}
